home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / QD3DView.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  12.9 KB  |  288 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DView.p
  3.  
  4.      Contains:    View types and routines                                            
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.1
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1995-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT QD3DView;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __QD3DVIEW__}
  28. {$SETC __QD3DVIEW__ := 1}
  29.  
  30. {$I+}
  31. {$SETC QD3DViewIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __QD3D__}
  35. {$I QD3D.p}
  36. {$ENDC}
  37.  
  38. {$IFC UNDEFINED __QD3DSTYLE__}
  39. {$I QD3DStyle.p}
  40. {$ENDC}
  41. {$IFC UNDEFINED __QD3DSET__}
  42. {$I QD3DSet.p}
  43. {$ENDC}
  44.  
  45.  
  46. {$PUSH}
  47. {$ALIGN POWER}
  48. {$LibExport+}
  49.  
  50. {*****************************************************************************
  51.  **                                                                             **
  52.  **                        View Type Definitions                                 **
  53.  **                                                                             **
  54.  ****************************************************************************}
  55.  
  56. TYPE
  57.     TQ3ViewStatus                 = LONGINT;
  58. CONST
  59.     kQ3ViewStatusDone            = {TQ3ViewStatus}0;
  60.     kQ3ViewStatusRetraverse        = {TQ3ViewStatus}1;
  61.     kQ3ViewStatusError            = {TQ3ViewStatus}2;
  62.     kQ3ViewStatusCancelled        = {TQ3ViewStatus}3;
  63.  
  64.  
  65. {*****************************************************************************
  66.  **                                                                             **
  67.  **                        Default Attribute Set                                 **
  68.  **                                                                             **
  69.  ****************************************************************************}
  70.  
  71. {*****************************************************************************
  72.  **                                                                             **
  73.  **                            View Routines                                     **
  74.  **                                                                             **
  75.  ****************************************************************************}
  76. FUNCTION Q3View_New: TQ3ViewObject; C;
  77. FUNCTION Q3View_Cancel(view: TQ3ViewObject): TQ3Status; C;
  78. {*****************************************************************************
  79.  **                                                                             **
  80.  **                        View Rendering routines                                 **
  81.  **                                                                             **
  82.  ****************************************************************************}
  83. FUNCTION Q3View_SetRendererByType(view: TQ3ViewObject; theType: TQ3ObjectType): TQ3Status; C;
  84. FUNCTION Q3View_SetRenderer(view: TQ3ViewObject; renderer: TQ3RendererObject): TQ3Status; C;
  85. FUNCTION Q3View_GetRenderer(view: TQ3ViewObject; VAR renderer: TQ3RendererObject): TQ3Status; C;
  86. FUNCTION Q3View_StartRendering(view: TQ3ViewObject): TQ3Status; C;
  87. FUNCTION Q3View_EndRendering(view: TQ3ViewObject): TQ3ViewStatus; C;
  88. FUNCTION Q3View_Flush(view: TQ3ViewObject): TQ3Status; C;
  89. FUNCTION Q3View_Sync(view: TQ3ViewObject): TQ3Status; C;
  90.  
  91. {*****************************************************************************
  92.  **                                                                             **
  93.  **                        View/Bounds/Pick routines                             **
  94.  **                                                                             **
  95.  ****************************************************************************}
  96. FUNCTION Q3View_StartBoundingBox(view: TQ3ViewObject; computeBounds: TQ3ComputeBounds): TQ3Status; C;
  97. FUNCTION Q3View_EndBoundingBox(view: TQ3ViewObject; VAR result: TQ3BoundingBox): TQ3ViewStatus; C;
  98. FUNCTION Q3View_StartBoundingSphere(view: TQ3ViewObject; computeBounds: TQ3ComputeBounds): TQ3Status; C;
  99. FUNCTION Q3View_EndBoundingSphere(view: TQ3ViewObject; VAR result: TQ3BoundingSphere): TQ3ViewStatus; C;
  100. FUNCTION Q3View_StartPicking(view: TQ3ViewObject; pick: TQ3PickObject): TQ3Status; C;
  101. FUNCTION Q3View_EndPicking(view: TQ3ViewObject): TQ3ViewStatus; C;
  102.  
  103. {*****************************************************************************
  104.  **                                                                             **
  105.  **                            View/Camera routines                             **
  106.  **                                                                             **
  107.  ****************************************************************************}
  108. FUNCTION Q3View_GetCamera(view: TQ3ViewObject; VAR camera: TQ3CameraObject): TQ3Status; C;
  109. FUNCTION Q3View_SetCamera(view: TQ3ViewObject; camera: TQ3CameraObject): TQ3Status; C;
  110.  
  111. {*****************************************************************************
  112.  **                                                                             **
  113.  **                            View/Lights routines                             **
  114.  **                                                                             **
  115.  ****************************************************************************}
  116. FUNCTION Q3View_SetLightGroup(view: TQ3ViewObject; lightGroup: TQ3GroupObject): TQ3Status; C;
  117. FUNCTION Q3View_GetLightGroup(view: TQ3ViewObject; VAR lightGroup: TQ3GroupObject): TQ3Status; C;
  118.  
  119. {*****************************************************************************
  120.  **                                                                             **
  121.  **                                Idle Method                                     **
  122.  **                                                                             **
  123.  ****************************************************************************}
  124. {
  125.  *    The idle methods allow the application to register callback routines 
  126.  *    which will be called by the view during especially long operations.
  127.  *
  128.  *    The idle methods may also be used to interrupt long renderings or
  129.  *    traversals.  Inside    the idler callback the application can check for
  130.  *    Command-Period, Control-C or clicking a "Cancel" button or whatever else
  131.  *    may be used to let the user interrupt rendering.    
  132.  *
  133.  *    It is NOT LEGAL to call QD3D routines inside an idler callback.
  134.  *
  135.  *    Return kQ3Failure to cancel rendering, kQ3Success to continue. Don't
  136.  *    bother posting an error.
  137.  *
  138.  *    Q3View_SetIdleMethod registers a callback that can be called
  139.  *    by the system during rendering.  Unfortunately there is no way yet
  140.  *    to set timer intervals when you want to be called.  Basically, it is
  141.  *    up to the application's idler callback to check clocks to see if you
  142.  *    were called back only a millisecond ago or an hour ago!
  143.  *
  144.  *    Q3View_SetIdleProgressMethod registers a callback that also gives
  145.  *    progress information. This information is supplied by the renderer, and
  146.  *    may or may not be based on real time.
  147.  *
  148.  *    If a renderer doesn't support the progress method, your method will be
  149.  *    called with current == 0 and completed == 0.
  150.  *    
  151.  *    Otherwise, you are GUARANTEED to get called at least 2 or more times:
  152.  *    
  153.  *    ONCE            idleMethod(view, 0, n)        -> Initialize, Show Dialog
  154.  *    zero or more    idleMethod(view, 1..n-1, n) -> Update progress
  155.  *    ONCE            idleMethod(view, n, n)        -> Exit, Hide Dialog
  156.  *    
  157.  *    "current" is guaranteed to be less than or equal to "completed"
  158.  *    "completed" may change values, but current/complete always indicates
  159.  *    the degree of completion.
  160.  *
  161.  *    The calling conventions aid in managing any data associated with a 
  162.  *    progress user interface indicator.
  163.  }
  164.  
  165. TYPE
  166.     TQ3ViewIdleMethod = ProcPtr;  { FUNCTION TQ3ViewIdleMethod(view: TQ3ViewObject; idlerData: UNIV Ptr): TQ3Status; C; }
  167.  
  168.     TQ3ViewIdleProgressMethod = ProcPtr;  { FUNCTION TQ3ViewIdleProgressMethod(view: TQ3ViewObject; idlerData: UNIV Ptr; current: LONGINT; completed: LONGINT): TQ3Status; C; }
  169.  
  170. FUNCTION Q3View_SetIdleMethod(view: TQ3ViewObject; idleMethod: TQ3ViewIdleMethod; idleData: UNIV Ptr): TQ3Status; C;
  171. FUNCTION Q3View_SetIdleProgressMethod(view: TQ3ViewObject; idleMethod: TQ3ViewIdleProgressMethod; idleData: UNIV Ptr): TQ3Status; C;
  172.  
  173. {*****************************************************************************
  174.  **                                                                             **
  175.  **                                EndFrame Method                                 **
  176.  **                                                                             **
  177.  ****************************************************************************}
  178. {
  179.  *    The end frame method is an alternate way of determining when an
  180.  *    asynchronous renderer has completed rendering a frame. It differs from
  181.  *    Q3View_Sync in that notification of the frame completion is the opposite
  182.  *    direction. 
  183.  *    
  184.  *    With Q3View_Sync the application asks a renderer to finish rendering
  185.  *    a frame, and blocks until the frame is complete.
  186.  *    
  187.  *    With the EndFrame method, the renderer tells the application that is has
  188.  *    completed a frame.
  189.  *
  190.  *    If "Q3View_Sync" is called BEFORE this method has been called, this
  191.  *    method will NOT be called ever.
  192.  *    
  193.  *    If "Q3View_Sync" is called AFTER this method has been called, the
  194.  *    call will return immediately (as the frame has already been completed).
  195.  }
  196.  
  197. TYPE
  198.     TQ3ViewEndFrameMethod = ProcPtr;  { PROCEDURE TQ3ViewEndFrameMethod(view: TQ3ViewObject; endFrameData: UNIV Ptr); C; }
  199.  
  200. FUNCTION Q3View_SetEndFrameMethod(view: TQ3ViewObject; endFrame: TQ3ViewEndFrameMethod; endFrameData: UNIV Ptr): TQ3Status; C;
  201.  
  202. {*****************************************************************************
  203.  **                                                                             **
  204.  **                            Push/Pop routines                                 **
  205.  **                                                                             **
  206.  ****************************************************************************}
  207. FUNCTION Q3Push_Submit(view: TQ3ViewObject): TQ3Status; C;
  208. FUNCTION Q3Pop_Submit(view: TQ3ViewObject): TQ3Status; C;
  209.  
  210. {*****************************************************************************
  211.  **                                                                             **
  212.  **        Check if bounding box is visible in the viewing frustum.  Transforms **
  213.  **        the bbox by the current local_to_world transformation matrix and     **
  214.  **        does a clip test to see if it lies in the viewing frustum.             **
  215.  **        This can be used by applications to cull out large chunks of scenes     **
  216.  **        that are not going to be visible.                                     **
  217.  **                                                                             **
  218.  **        The default implementation is to always return kQ3True.  Renderers     **
  219.  **        may override this routine however to do the checking.                 **
  220.  **                                                                             **
  221.  ****************************************************************************}
  222. FUNCTION Q3View_IsBoundingBoxVisible(view: TQ3ViewObject; {CONST}VAR bbox: TQ3BoundingBox): TQ3Boolean; C;
  223.  
  224. {*****************************************************************************
  225.  **                                                                             **
  226.  **                            DrawContext routines                             **
  227.  **                                                                             **
  228.  ****************************************************************************}
  229. FUNCTION Q3View_SetDrawContext(view: TQ3ViewObject; drawContext: TQ3DrawContextObject): TQ3Status; C;
  230. FUNCTION Q3View_GetDrawContext(view: TQ3ViewObject; VAR drawContext: TQ3DrawContextObject): TQ3Status; C;
  231.  
  232. {*****************************************************************************
  233.  **                                                                             **
  234.  **                            Graphics State routines                             **
  235.  **                                                                             **
  236.  ** The graphics state routines can only be called while rendering (ie. in     **
  237.  ** between calls to start and end rendering calls).  If they are called     **
  238.  ** outside of a rendering loop, they will return with error.                 **
  239.  **                                                                             **
  240.  ****************************************************************************}
  241. {*****************************************************************************
  242.  **                                                                             **
  243.  **                            Transform routines                                 **
  244.  **                                                                             **
  245.  ****************************************************************************}
  246. FUNCTION Q3View_GetLocalToWorldMatrixState(view: TQ3ViewObject; VAR matrix: TQ3Matrix4x4): TQ3Status; C;
  247. FUNCTION Q3View_GetWorldToFrustumMatrixState(view: TQ3ViewObject; VAR matrix: TQ3Matrix4x4): TQ3Status; C;
  248. FUNCTION Q3View_GetFrustumToWindowMatrixState(view: TQ3ViewObject; VAR matrix: TQ3Matrix4x4): TQ3Status; C;
  249.  
  250. {*****************************************************************************
  251.  **                                                                             **
  252.  **                            Style state routines                             **
  253.  **                                                                             **
  254.  ****************************************************************************}
  255. FUNCTION Q3View_GetBackfacingStyleState(view: TQ3ViewObject; VAR backfacingStyle: TQ3BackfacingStyle): TQ3Status; C;
  256. FUNCTION Q3View_GetInterpolationStyleState(view: TQ3ViewObject; VAR interpolationType: TQ3InterpolationStyle): TQ3Status; C;
  257. FUNCTION Q3View_GetFillStyleState(view: TQ3ViewObject; VAR fillStyle: TQ3FillStyle): TQ3Status; C;
  258. FUNCTION Q3View_GetHighlightStyleState(view: TQ3ViewObject; VAR highlightStyle: TQ3AttributeSet): TQ3Status; C;
  259. FUNCTION Q3View_GetSubdivisionStyleState(view: TQ3ViewObject; VAR subdivisionStyle: TQ3SubdivisionStyleData): TQ3Status; C;
  260. FUNCTION Q3View_GetOrientationStyleState(view: TQ3ViewObject; VAR fontFacingDirectionStyle: TQ3OrientationStyle): TQ3Status; C;
  261. FUNCTION Q3View_GetReceiveShadowsStyleState(view: TQ3ViewObject; VAR receives: TQ3Boolean): TQ3Status; C;
  262. FUNCTION Q3View_GetPickIDStyleState(view: TQ3ViewObject; VAR pickIDStyle: LONGINT): TQ3Status; C;
  263. FUNCTION Q3View_GetPickPartsStyleState(view: TQ3ViewObject; VAR pickPartsStyle: TQ3PickParts): TQ3Status; C;
  264. FUNCTION Q3View_GetAntiAliasStyleState(view: TQ3ViewObject; VAR antiAliasData: TQ3AntiAliasStyleData): TQ3Status; C;
  265.  
  266. {*****************************************************************************
  267.  **                                                                             **
  268.  **                        Attribute state routines                             **
  269.  **                                                                             **
  270.  ****************************************************************************}
  271. FUNCTION Q3View_GetDefaultAttributeSet(view: TQ3ViewObject; VAR attributeSet: TQ3AttributeSet): TQ3Status; C;
  272. FUNCTION Q3View_SetDefaultAttributeSet(view: TQ3ViewObject; attributeSet: TQ3AttributeSet): TQ3Status; C;
  273.  
  274. FUNCTION Q3View_GetAttributeSetState(view: TQ3ViewObject; VAR attributeSet: TQ3AttributeSet): TQ3Status; C;
  275. FUNCTION Q3View_GetAttributeState(view: TQ3ViewObject; attributeType: TQ3AttributeType; data: UNIV Ptr): TQ3Status; C;
  276.  
  277.  
  278. {$ALIGN RESET}
  279. {$POP}
  280.  
  281. {$SETC UsingIncludes := QD3DViewIncludes}
  282.  
  283. {$ENDC} {__QD3DVIEW__}
  284.  
  285. {$IFC NOT UsingIncludes}
  286.  END.
  287. {$ENDC}
  288.